package com.myTimeUtils.android.TimeTracker.System;
import com.myTimeUtils.android.TimeTracker.Schedule.Time;
/**
 * Provides a way for any class to get the current time defined in a way
 * specific to this library. This will use a system dependent time and convert
 * the returned time to that of type Time.
 *
 * @author Joseph Walker
 */
public class CurrentTime{
	private static CurrentTime currentTime;
	private SystemTime systemTime;
	private CurrentTime(){
		this.systemTime = new ConcreteSystemTime();
	}
	/**
	 * Returns the current time in a format specific to this library.
	 *
	 * @return 			A formatting of the current time
	 */
	public static Time getTime(){
		if(currentTime == null) currentTime = new CurrentTime();
		return new Time(currentTime.getDay(), currentTime.getHour(), currentTime.getMinute(), currentTime.getSecond());
	}
	private int getDay(){ return this.systemTime.getDay(); }
	private int getHour(){ return this.systemTime.getHour(); }
	private int getMinute(){ return this.systemTime.getMinute(); }
	private int getSecond(){ return this.systemTime.getSecond(); }
}
